home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / translat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  7.3 KB  |  255 lines

  1. /* $XConsortium: TranslateI.h,v 1.25 90/08/17 15:48:27 swick Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  5. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  6.  
  7.                         All Rights Reserved
  8.  
  9. Permission to use, copy, modify, and distribute this software and its 
  10. documentation for any purpose and without fee is hereby granted, 
  11. provided that the above copyright notice appear in all copies and that
  12. both that copyright notice and this permission notice appear in 
  13. supporting documentation, and that the names of Digital or MIT not be
  14. used in advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.  
  16.  
  17. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  19. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24.  
  25. ******************************************************************/
  26.  
  27. /* 
  28.  * TranslateI.h - Header file private to translation management
  29.  * 
  30.  * Author:    Charles Haynes
  31.  *         Digital Equipment Corporation
  32.  *         Western Research Laboratory
  33.  * Date:    Sat Aug 29 1987
  34.  */
  35.  
  36. /*#define REFCNT_TRANSLATIONS*/
  37. #define CACHE_TRANSLATIONS
  38.  
  39. #define _XtRStateTablePair "_XtStateTablePair"
  40.  
  41. typedef Boolean (*MatchProc)();
  42.   /* Event parsed;
  43.      XEvent incoming;
  44.   */
  45.  
  46. typedef struct _ModToKeysymTable {
  47.     Modifiers mask;
  48.     int count;
  49.     int index;
  50. } ModToKeysymTable;
  51.  
  52. typedef struct _LateBindings {
  53.     Boolean knot;
  54.     Boolean pair;
  55.     KeySym keysym;
  56. } LateBindings, *LateBindingsPtr;
  57.  
  58. typedef short ModifierMask;
  59. typedef struct _EventObjRec *EventObjPtr;
  60. typedef struct _EventRec {
  61.     unsigned long modifiers;
  62.     unsigned long modifierMask;
  63.     LateBindingsPtr lateModifiers;
  64.     unsigned long eventType;
  65.     unsigned long eventCode;
  66.     unsigned long eventCodeMask;
  67.     MatchProc matchEvent;
  68.     Boolean standard;
  69. } Event;
  70.  
  71. typedef enum _TMkind {override,augment} TMkind;
  72.  
  73. typedef struct _EventObjRec {
  74.     Event event;    /* X event description */
  75.     StatePtr state;    /* pointer to linked lists of state info */
  76. } EventObjRec;
  77.  
  78. typedef struct _ActionsRec *ActionPtr;
  79. typedef struct _ActionsRec {
  80.     int index;            /* index into quarkTable to find proc */
  81.     String *params;        /* pointer to array of params */
  82.     Cardinal num_params;    /* number of params */
  83.     ActionPtr next;        /* next action to perform */
  84. } ActionRec;
  85.  
  86. typedef struct _StateRec {
  87.     int index;        /* index of event into EventObj table */
  88.     ActionPtr actions;    /* rhs list of actions to perform */
  89.     StatePtr nextLevel;    /* the next level points to the next event
  90.                in one event sequence */
  91.     StatePtr next;    /* points to other event state at same level */
  92.     StatePtr forw;    /* points to next state in list of all states */
  93.     Boolean cycle;    /* true iff nextLevel is a loop */
  94. }  StateRec;
  95. typedef enum {XtTableReplace,XtTableAugment,XtTableOverride} _XtTranslateOp;
  96.  
  97. typedef struct _StateTableData {
  98.     _XtTranslateOp    operation; /*replace,augment,override*/
  99.     unsigned int    numEvents;
  100.     unsigned int    eventTblSize;
  101.     EventObjPtr        eventObjTbl;
  102.     unsigned int    numQuarks;   /* # of entries in quarkTable */
  103.     unsigned int    quarkTblSize; /*total size of quarkTable */
  104.     XrmQuark*        quarkTable;  /* table of quarkified rhs*/
  105.     unsigned int    accNumQuarks;
  106.     unsigned int    accQuarkTblSize;
  107.     XrmQuark*        accQuarkTable;
  108.     StatePtr        head;    /* head of list of all states */
  109.     Boolean        mappingNotifyInterest;
  110. } StateTableData, *StateTablePtr;
  111.  
  112. typedef struct _XtBoundAccActionRec {
  113.     Widget widget;    /*widgetID to pass to action Proc*/
  114.     XtActionProc proc; /*action procedure */
  115. } XtBoundAccActionRec;
  116.  
  117. typedef struct _TranslationData {
  118.     StateTablePtr     stateTable;
  119.     XtBoundAccActionRec* accProcTbl;
  120. } TranslationData;
  121.  
  122. typedef struct _TMConvertRec {
  123.    StateTablePtr old; /* table to merge into */
  124.    StateTablePtr new; /* table to merge from */
  125.    TMkind  operation; /* merge or augment     */
  126. } TMConvertRec;
  127.  
  128. #define _XtEventTimerEventType ((unsigned long)-1L)
  129. #define KeysymModMask        (1<<27) /* private to TM */
  130. #define AnyButtonMask        (1<<28)    /* private to TM */
  131.  
  132. typedef struct _EventSeqRec *EventSeqPtr;
  133. typedef struct _EventSeqRec {
  134.     Event event;    /* X event description */
  135.     StatePtr state;    /* private to state table builder */
  136.     EventSeqPtr next;    /* next event on line */
  137.     ActionPtr actions;    /* r.h.s.   list of actions to perform */
  138. } EventSeqRec;
  139.  
  140. typedef EventSeqRec EventRec;
  141. typedef EventSeqPtr EventPtr;
  142. typedef struct _TMEventRec {
  143.     XEvent *xev;
  144.     Event event;
  145. }TMEventRec,*TMEventPtr;
  146.  
  147. extern void _XtAddEventSeqToStateTable();
  148. extern void _XtInitializeStateTable(); /* stateTable */
  149.     /* _XtTranslations *stateTable; */
  150.  
  151. typedef struct _ActionHookRec {
  152.     struct _ActionHookRec* next; /* must remain first */
  153.     XtAppContext app;
  154.     XtActionHookProc proc;
  155.     XtPointer closure;
  156. } ActionHookRec, *ActionHook;
  157.  
  158. typedef struct _TMContext {
  159.     XEvent *event;
  160.     unsigned long serial;
  161.     KeySym keysym;
  162.     Modifiers modifiers;
  163. } TMContextRec, *TMContext;
  164.  
  165. extern Boolean _XtMatchUsingStandardMods();
  166. extern Boolean _XtMatchUsingDontCareMods();
  167. extern Boolean _XtRegularMatch();
  168. extern Boolean _XtMatchAtom();
  169. extern void _XtConvertCase();
  170. extern void _XtBuildKeysymTables();
  171.  
  172. extern void _XtPopupInitialize();
  173.  
  174. extern void _XtInstallTranslations(
  175. #if NeedFunctionPrototypes
  176.     Widget        /* widget */,
  177.     XtTranslations    /* stateTable */
  178. #endif
  179. );
  180.  
  181. extern void _XtBindActions(
  182. #if NeedFunctionPrototypes
  183.     Widget    /* widget */,
  184.     XtTM    /* tm_rec */
  185. #endif
  186. );
  187.  
  188. extern void _XtTranslateInitialize();
  189.  
  190. extern XtTranslations _XtParseTranslationTable(
  191. #if NeedFunctionPrototypes
  192.     String /* source */
  193. #endif
  194. );
  195.  
  196. #if NeedWidePrototypes
  197. #define Boolean int
  198. #endif
  199.  
  200. extern void _XtRegisterGrabs(
  201. #if NeedFunctionPrototypes
  202.     Widget /* widget */,
  203.     Boolean /* acceleratorsOnly */
  204. #endif
  205. );
  206.  
  207. extern void _XtPopup(
  208. #if NeedFunctionPrototypes
  209.     Widget     /* widget */,
  210.     XtGrabKind     /* grab_kind */,
  211.     Boolean     /* spring_loaded */
  212. #endif
  213. );
  214.  
  215. #undef Boolean
  216.  
  217. extern XtTranslations _XtCondCopyTranslations(
  218. #if NeedFunctionPrototypes
  219.     XtTranslations /* translations */
  220. #endif
  221. );
  222.  
  223. extern void _XtRegisterAccRemoveCallbacks(
  224. #if NeedFunctionPrototypes
  225.     Widget /* dest */
  226. #endif
  227. );
  228.  
  229. extern void _XtUninstallAccelerators(
  230. #if NeedFunctionPrototypes
  231.     Widget /* w */
  232. #endif
  233. );
  234.  
  235. extern Boolean _XtCvtMergeTranslations(
  236. #if NeedFunctionPrototypes
  237.     Display*    /* dpy */,
  238.     XrmValuePtr /* args */,
  239.     Cardinal*    /* num_args */,
  240.     XrmValuePtr /* from */,
  241.     XrmValuePtr /* to */,
  242.     XtPointer*    /* closure_ret */
  243. #endif
  244. );
  245.  
  246. void _XtFreeTranslations(
  247. #if NeedFunctionPrototypes
  248.     XtAppContext /* app */,
  249.     XrmValuePtr  /* toVal */,
  250.     XtPointer    /* closure */,
  251.     XrmValuePtr  /* args */,
  252.     Cardinal*     /* num_args */
  253. #endif
  254. );
  255.